﻿using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OpenWTF.Selenium
{
    public class SeleniumWebDriver
    {
        private static IWebDriver _driver;
        private string _browser;

        public SeleniumWebDriver()
        {
            this._browser = "Chrome";
        }

        public SeleniumWebDriver(string browser)
        {
            this._browser = browser;
        }

        private void InitWebDriver()
        {
            ChromeOptions chrOptions = new ChromeOptions();
            chrOptions.AddArgument("--start-maximized");
            IWebDriver chrDriver = new ChromeDriver(chrOptions);
            _driver = new SeleniumEventListener(chrDriver);
        }

        public static IWebDriver getDriver()
        {
            return _driver;
        }
    }
}
